package com.example.wemedia.service.impl;

import com.example.wemedia.dao.WmMaterialDao;
import com.example.wemedia.service.WmMaterialService;
import com.usian.model.media.pojos.WmMaterial;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WmMaterialServiceImpl  implements WmMaterialService {

   @Autowired
   private WmMaterialDao wmMaterialDao;

    @Override
    public Integer saveMaterial(String imgUrl,String type) {
        WmMaterial wmMaterial = new WmMaterial();
        wmMaterial.setUrl(imgUrl);
        wmMaterial.setType(type);
        wmMaterial.setCreatedTime(new Date());
        return  wmMaterialDao.insert(wmMaterial);
    }
}
